trigger updateStatusfieldtoclosed on Project__c (before insert,after insert) 
{

    
    List<Project__c> snaglistwithprojects=[select id,(select id, Status__c from SnagLists__r) from Project__c where Id IN :Trigger.newMap.keySet()];  
    List<SnagList__c> snaglist= new List<SnagList__c>{};
    
    for(Project__c p:snaglistwithprojects)    
        {
        
        for(SnagList__c s:p.SnagLists__r)
            {
            
            
            }
            
        }

}